/***************************************************************************
 * The Open Armory API is a project to retrieve World of Warcraft(R) 
 * related XML data from The Armory.
 * 
 * The data retrieved via the Open Armory API from The Armory is 
 * proprietary to Blizzard Entertainment, Inc(R).
 * *************************************************************************
 * Copyright (C) 2009 - 2010 Tedla M.B. Brandsema
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ***************************************************************************/
package net.openarmory.core.domain.url;

import net.openarmory.core.domain.constants.ArmoryContentGroup;

import org.apache.log4j.Logger;

// TODO: Auto-generated Javadoc
/**
 * A factory for creating ArmoryUrl objects.
 */
public final class ArmoryUrlFactory {

	/** The log. */
	private static final Logger LOG = Logger.getLogger(ArmoryUrlFactory.class);

	/**
	 * Instantiates a new armory url factory.
	 */
	private ArmoryUrlFactory() {

	}

	/**
	 * Gets the url builder.
	 * 
	 * @param contentGroup
	 *            the content group
	 * @return the url builder
	 */
	public static ArmoryUrlBuilder getUrlBuilder(
			final ArmoryContentGroup contentGroup) {

		switch (contentGroup) {
		case CHARACTER:
			return new ArmoryCharacterUrlBuilder();
		case GUILD:
			return new ArmoryGuildUrlBuilder();
		case ITEM:
			return new ArmoryItemUrlBuilder();
		case IMAGE:
			return new ArmoryImageUrlBuilder();
		default:
			LOG.error("No match for content group: " + contentGroup);
			return null;
		}
	}

}
